package com.bawei.module_shop.order;

import com.bawei.library_base.room.good.Good;
import com.bawei.library_base.utils.GlideUtil;
import com.bawei.module_shop.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @author : zhiyu
 * @date : 2021/12/20
 * @content :
 */
public class OrderAdapter extends BaseQuickAdapter<Good, BaseViewHolder> {
    public OrderAdapter( @Nullable List<Good> data) {
        super(R.layout.layout_order_goods_item, data);
    }


    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, Good good) {
        GlideUtil.getInstance().LoadImage(getContext(),good.getImgUrl(),baseViewHolder.getView(R.id.mGoodsIconIv));
        baseViewHolder.setText(R.id.mGoodsSkuTv,good.getName());
        baseViewHolder.setText(R.id.mGoodsCountTv,""+good.getCount());

    }
}
